import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/login',
    },
    // home
    {
        path: '/layout',
        component: () => import('@/views/layout/Layout.vue'),
        name: '首页',
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/Home.vue'),
                name: '总览',
                meta: {
                    title: '总览',
                    breadcrumbName: '总览',
                },
            },
        ],
    },
    {
        path: '/register',
        component: () => import('@/views/register/Register.vue'),
    },
    {
        path: '/resourcebundle',
        component: () => import('@/views/layout/Layout.vue'),
        name: '资源包管理',
        meta: {
            title: '资源包管理',
            breadcrumbName: '资源包管理',
        },
        redirect: '/resourcebundle/resourceListCenter',
        children: [
            {
                path: '/resourceListCenter',
                component: () => import('@/views/resourcebundle/ResourceListCenter.vue'),
                name: '列表管理',
                meta: {
                    title: '列表管理',
                    breadcrumbName: '列表管理',
                },
            },
            {
                path: '/sortClass',
                component: () => import('@/views/resourcebundle/SortClass.vue'),
                name: '类型管理',
                meta: {
                    title: '类型管理',
                    breadcrumbName: '类型管理',
                },
            },
        ],
    },
    {
        path: '/system',
        component: () => import('@/views/layout/Layout.vue'),
        name: '系统管理',
        meta: {
            title: '系统管理',
            breadcrumbName: '系统管理',
        },
        redirect: '/system/user',
        children: [
            {
                path: '/user',
                component: () => import('@/views/system/User.vue'),
                name: '用户管理',
                meta: {
                    title: '用户管理',
                    breadcrumbName: '用户管理',
                },
            },
            {
                path: '/systemLog',
                component: () => import('@/views/system/SystemLog.vue'),
                name: '操作日志',
                meta: {
                    title: '操作日志',
                    breadcrumbName: '操作日志',
                },
            },
        ],
    },
];

const wihitetRoutes: RouteRecordRaw[] = [
    {
        name: 'login',
        path: '/login',
        component: () => import('@/views/login/Login.vue'),
        meta: {
            title: '登录',
            fullScreen: true,
        },
    },
];

export default [...routes, ...wihitetRoutes];
